﻿using System;

namespace Meqs.Entity
{
    /// <summary>
    /// 权限表
    /// </summary>
    [Serializable]
    public class PremInfo
    {
        private int _rID;
        private int _systemNo;
        private int _premNo;
        private string _premName;
        private int _premType;
        private string _remark;

        public PremInfo()
        {
        }

        public PremInfo(int rID, int systemNo, int premNo, string premName, int premType, string remark)
        {
            _rID = rID;
            _systemNo = systemNo;
            _premNo = premNo;
            _premName = premName;
            _premType = premType;
            _remark = remark;
        }

        public int RID
        {
            get { return _rID; }
            set { _rID = value; }
        }

        /// <summary>
        /// 系统编号
        /// </summary>
        public int SystemNo
        {
            get { return _systemNo; }
            set { _systemNo = value; }
        }

        /// <summary>
        /// 权限编号
        /// </summary>
        public int PremNo
        {
            get { return _premNo; }
            set { _premNo = value; }
        }

        /// <summary>
        /// 权限名称
        /// </summary>
        public string PremName
        {
            get { return _premName; }
            set { _premName = value; }
        }

        /// <summary>
        /// 权限类型
        /// </summary>
        public int PremType
        {
            get { return _premType; }
            set { _premType = value; }
        }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark
        {
            get { return _remark; }
            set { _remark = value; }
        }

        public bool Equals(PremInfo other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return other._rID == _rID;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof (PremInfo)) return false;
            return Equals((PremInfo) obj);
        }

        public override int GetHashCode()
        {
            return _rID;
        }
    }
}
